package com.service;

public class Controller {
	
	public int resultType = -1; //-1非法， 0创建会员卡，1年卡
	public Controller controller = null;
	
	public Controller() {
		
	}
	public Controller(String command, int type) {
		
		resultType = type;
		if (type == 0) {
			controller = new MemberController(command, type);
		} else {
			controller = new CardController(command, type);
		}
		
		
	}
	
	public Object getResult() {
		
		if (resultType == 0) {
			MemberController memberController = (MemberController)controller;
			return memberController.queryResult();
		} else {
			CardController cardController = (CardController)controller;
			return cardController.queryResult();
		}
	}
	
	
	
	

}
